package com.epalmpay.service.activity.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.epalmpay.entity.ActivityRoutineRegister;
import com.epalmpay.mapper.ActivityRoutineRegisterMapper;
import com.epalmpay.service.activity.IActivityRoutineRegisterService;

/**
 * Created by Administrator on 2017/5/31.
 */
@Service("activityRoutineRegisterService")
public class ActivityRoutineRegisterImpl implements IActivityRoutineRegisterService{

    @Resource
    ActivityRoutineRegisterMapper activityRoutineRegisterMapper;


    @Override
    public ActivityRoutineRegister QueryActivityByActivityId(Long activityId) throws Exception {

        ActivityRoutineRegister activityRoutineRegister=activityRoutineRegisterMapper.selectByPrimaryKeyLeftJonhBaseData(activityId);
        return activityRoutineRegister;
    }

    @Override
    public int UpdateActivityByActivityId(ActivityRoutineRegister activityRoutineRegister) throws Exception {
        activityRoutineRegister.setFirstInviterAmount(activityRoutineRegister.getFirstInviterAmount());
        activityRoutineRegister.setFirstInviterFullAmount(activityRoutineRegister.getFirstInviterFullAmount());

        int status=activityRoutineRegisterMapper.updateByPrimaryKeySelective(activityRoutineRegister);
        return status;
    }
}
